POV-Ray : Newsgroups : povray.newusers : How can I do an arrow? : Re: How can I do an arrow? Server Time
2 Nov 2024 07:24:06 EDT (-0400)
  Re: How can I do an arrow?  
From: Hughes, B 
Date: 6 Aug 2004 09:40:56
Message: <41138a68@news.povray.org>
"Oleguer Vilella" <ole### [at] infonegociocom> wrote in message
news:411381da@news.povray.org...
> union {
> cone { <0,0,0>,2,<3,0,0>,0  }
> cylinder  { <-5,0,0>,<0,0,0>,1 }
> pigment { rgb<0,1.1,0> }
> scale <0.9, 1.6, 1>
> translate <120, 40, 26>
> rotate <-0, 0, -26>
> no_shadow
> }
> To the arrow. I have trayed to rotate it to an other direction. I want to
> put the cone looking on the other side of the screen, but I couldn't. When
I
> modified the "rotate" vector, all the arrow desapear. What's the problem??

Hi again, Oleguer.

Probably because of the translate before rotate, which will tend to move it
a lot more than just turning it around.

You need to watch the order of transformations you use. And also, I think
you might not be thinking of degrees of rotate, i.e. 180 = half circle, and
instead units (your translate 26 then rotate -26) but I'd only be guessing
what you're really trying. So maybe you do realize rotate is in degrees by
default and that is coincidental numbers. Anyway...

That aside, when building an object, try to keep it at or near the origin
(<0,0,0>) and scale it first, secondly do rotate (or rotate first then
scale, depending on the situation), lastly translate. That way you are able
to turn the objects based on the origin and move around from there. Helps to
keep it in one place until the final move. Of course, the better you get at
it the easier it is to know how to use other locations and move things
around. But for simplicities sake, this scale>rotate>translate method works
well as long as your object is created at <0,0,0> for some part of it.

For example:

union {
cone { <0,0,0>,2,<3,0,0>,0  }
cylinder  { <-5,0,0>,<0,0,0>,1 }
pigment { rgb<0,1.1,0> }
scale <0.9, 1.6, 1>
rotate 180*y // face left
translate <220, -15, -16> // to right of look_at point
no_shadow
}

Not sure if this is anything like you wanted to do but it's on the other
side now and pointing toward the middle. You'll catch on to the idea if you
order your transformations correctly. In fact, you might discover that
rotate itself has order, so if you must turn it around the y axis and then x
you need to use two rotates, since a single one can't be reordered from
x,y,z. E.g. rotate <0,180,0> rotate <180,0,0>.

Bob H.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.